<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <h1>登录</h1>
    <div>用户：<input id="name" name="name"/></div>
    <div>密码：<input id="password" name="password"/></div>
    <input type="button" onclick="submit()" value="提交">
</body>
<script>
    function submit() {
        jQuery.ajax({
            url:"/user/login",
            type:"POST",
            data:{
                "name":jQuery("#name").val(),
                "password":jQuery("#password").val(),
            },
            success:function(body) {
                alert(body);
                console.dir(body);
            }
        })
    }
</script>
</html>